﻿Public Class frmSenhaBd
    Private prvSenha As String
    Public ReadOnly Property SenhaBD()
        Get
            Return prvSenha.Trim
        End Get
    End Property
    Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOk.Click
        Try
            prvSenha = txtSenha.Text.Trim
            Me.DialogResult = Windows.Forms.DialogResult.OK
            Me.Close()
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, Me.Text)
        End Try

    End Sub

    Private Sub cmdSair_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancelar.Click, cmdCancelar.Click

        Me.DialogResult = Windows.Forms.DialogResult.Cancel

    End Sub

    Private Sub txtSenha_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSenha.KeyPress
        If e.KeyChar = Convert.ToChar(13) Then
            e.Handled = True
            Call cmdOk_Click(sender, e)
        End If
    End Sub
End Class